#ifndef __AT24C64_H
#define	__AT24C64_H


#define EEPROM_ADDR                     0xA0

#define  STM32_I2C_OWN_ADDR             0x5F
#define  EEPROM_I2C                     I2C2
#define  EEPROM_I2C_CLK                 RCC_APB1Periph_I2C2
#define  EEPROM_I2C_APBxClkCmd          RCC_APB1PeriphClockCmd
#define  EEPROM_I2C_BAUDRATE            400000


#define  EEPROM_SCL_GPIO_CLK           (RCC_APB2Periph_GPIOB)
#define  EEPROM_SDA_GPIO_CLK           (RCC_APB2Periph_GPIOB)

#define  EEPROM_I2C_GPIO_APBxClkCmd     RCC_APB2PeriphClockCmd

#define  EEPROM_SCL_GPIO_PORT       GPIOB  
#define  EEPROM_SCL_GPIO_PIN        GPIO_Pin_10
#define  EEPROM_SDA_GPIO_PORT       GPIOB
#define  EEPROM_SDA_GPIO_PIN        GPIO_Pin_11

void I2C_EE_Config(void);
void EEPROM_Byte_Write(uint16_t addr,uint8_t data);
void EEPROM_ReadReg(uint16_t addr,uint8_t *data,uint8_t numByteToRead);
void EEPROM_WaitForWriteEnd(void);
void EEPROM_Page_Write(uint16_t addr,uint8_t *data,uint8_t numByteToWrite);
#endif
